/*
 * Toedo
 * Copyright (C) 2009-2010 J. Devauchelle and contributors.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * version 3 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

package org.toedo.preferences;

import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.jface.preference.IPreferenceStore;
import org.toedo.model.enums.SortDirection;
import org.toedo.model.enums.TaskField;
import org.toedo.model.enums.WikiMarkupType;
import org.toedo.Activator;

public class PreferenceInitializer extends AbstractPreferenceInitializer {

	public PreferenceInitializer() {
		// TODO Auto-generated constructor stub
	}

	@Override
	public void initializeDefaultPreferences() {
		IPreferenceStore store = Activator.getDefault().getPreferenceStore();

		store.setDefault(PreferenceConstants.PROJECT_DEFAULT_START_DATE_DELAY, 0);
		store.setDefault(PreferenceConstants.PROJECT_DEFAULT_TASK_DURATION, 7);
		store.setDefault(PreferenceConstants.PROJECT_DEFAULT_TASK_PRIORITY, 5);
		store.setDefault(PreferenceConstants.PROJECT_DEFAULT_URGENT_DELAY, 5);
		store.setDefault(PreferenceConstants.PROJECT_DEFAULT_WIKI_MARKUP, WikiMarkupType.EnTextile.getValue());
		
		store.setDefault(PreferenceConstants.DISPLAY_DATE_FORMAT, "MM-dd-yyyy"); //$NON-NLS-1$
		store.setDefault(PreferenceConstants.DISPLAY_TIME_FORMAT, "HH:mm:ss"); //$NON-NLS-1$
		
		store.setDefault(PreferenceConstants.TASKSLIST_HIDE_CLOSED_TASKS, false);
		store.setDefault(PreferenceConstants.TASKSLIST_SORT_FIELD, TaskField.EnStartDate.getValue());
		store.setDefault(PreferenceConstants.TASKSLIST_SORT_DIRECTION, SortDirection.EnAscending.getValue());
		store.setDefault(PreferenceConstants.TASKSLIST_TAGS_SORT_DIRECTION, SortDirection.EnAscending.getValue());
		
		store.setDefault(PreferenceConstants.NOTESLIST_SORT_DIRECTION, SortDirection.EnAscending.getValue());
		store.setDefault(PreferenceConstants.NOTESLIST_TAGS_SORT_DIRECTION, SortDirection.EnAscending.getValue());
		
		store.setDefault(PreferenceConstants.OPEN_LAST_PROJECT_AT_STARTUP, false);
		store.setDefault(PreferenceConstants.LAST_OPEN_PROJECT, ""); //$NON-NLS-1$
		
		store.setDefault(PreferenceConstants.AUTOSAVE_ON_EXIT, false);
		
		store.setDefault(PreferenceConstants.TRAY_SHOW_TRAY_ICON, false);
		store.setDefault(PreferenceConstants.TRAY_MINIMIZE_ON_CLOSE, false);
		
		store.setDefault(PreferenceConstants.DASHBOARD_TOOLS_EXPANDED, true); //$NON-NLS-1$
		
		store.setDefault(PreferenceConstants.DISPLAY_CUSTOM_CSS, ""); //$NON-NLS-1$
	}	

}
